package com.r2coding.system.controller;

import com.r2coding.common.enums.Module;
import com.r2coding.common.enums.OperationType;
import com.r2coding.system.annotation.SysLog;
import com.r2coding.system.vo.req.WebsiteReqVo;
import org.springframework.beans.factory.annotation.Autowired;

import com.r2coding.system.service.WebsiteService;
import com.r2coding.common.util.Result;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * 网站配置信息控制器
 *
 * @author 98k灬
 * @email hk666zx@163.com
 * @date 2022-07-16 22:51:34
 */
@RestController
@RequestMapping("/website")
public class WebsiteController {
    @Autowired
    private WebsiteService websiteService;

    /**
     * 修改
     */
    @SysLog(module = Module.WEBSITE, operationType = OperationType.UPDATE, description = "更新网站配置")
    @PreAuthorize("hasAuthority('website:edit')")
    @PutMapping("/update")
    public Result update(@RequestBody WebsiteReqVo req){
		websiteService.updateInfo(req);
        return Result.ok();
    }
}
